package com.hm.scala.obj

import scala.beans.BeanProperty
import java.util.Date

class Person {

  var name: String = "";
  var age: Int = 0;
  @BeanProperty var addr: String = null;
  @BeanProperty var birth: Date = null;

  def toStr() = {
    println("person 信息结构为name=" + name + ";age=" + this.age)
  }

  def this(name: String) {
    this()
    this.name = name

    println("调用一个参数构造方法")
  }

  def this(name: String, age: Int) {
    this()
    this.name = name
    this.age = age

    println("调用多参数构造方法")
  }

  private def test() = {
    println("私有方法其他地方没法调用")
  }

}